import config from "@/config"
import http from "@/utils/request"

export default {
    
	news: {
		getMyNewsListForApp:{
			url: `${config.API_URL}/get/iciPartyNews/getMyNewsListForApp`,
			name: "获取移动端企业新闻的列表",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		getNewsManageList: {
			url: `${config.API_URL}/get/iciPartyNews/getNewsManageList`,
			name: "获取新闻管理列表",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		getMyNewsList: {
			url: `${config.API_URL}/get/iciPartyNews/getMyNewsList`,
			name: "获取个人权限内的新闻",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		update: {
			url: `${config.API_URL}/set/iciPartyNews/updateNews`,
			name: "更新新闻",
			post: async function (data) {
				return await http.bigPost(this.url, data,
					{headers: {'Content-Type': 'multipart/form-data'}}
				);
			}
		},
		insert: {
			url: `${config.API_URL}/set/iciPartyNews/insertNews`,
			name: "发布新闻",
			post: async function (data) {
				return await http.bigPost(this.url, data,
					{headers: {'Content-Type': 'multipart/form-data'}}
				);
			}
		},
		delete: {
			url: `${config.API_URL}/set/iciPartyNews/deleteNews`,
			name: "删除新闻",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, {
					headers: {}
				});
			}
		},
		deleteNewsByIds:{
			url: `${config.API_URL}/set/iciPartyNews/deleteNewsByIds`,
			name: "批量删除新闻",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, {
					headers: {}
				});
			}
		},
		setNewsReadStatus: {
			url: `${config.API_URL}/set/iciPartyNews/setNewsReadStatus`,
			name: "设置新闻查看状态",
			post: async function (params) {
				return await http.post(this.url,params);
			}
		},
		getMyPicNewsListForDesk:{
			url: `${config.API_URL}/get/iciPartyNews/getMyPicNewsListForDesk`,
			name: "获取新闻图片",
			get: async function () {
				return await http.get(this.url);
			}
		},
		getMyNewsListForDesk:{
			url: `${config.API_URL}/get/iciPartyNews/getMyNewsListForDesk`,
			name: "获取新闻图片",
			get: async function () {
				return await http.get(this.url);
			}
		},
		getNewsReadStatus:{
			url: `${config.API_URL}/get/iciPartyNews/getNewsReadStatus`,
			name: "获取桌面新闻",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		getMyNewsById:{
			url: `${config.API_URL}/get/iciPartyNews/getMyNewsById`,
			name: "获取新闻详情",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		}
	},
	activity:{
		importBigStory:{
			url: `${config.API_URL}/set/iciPartyNews/importBigStory`,
			name: "导入大记事",
			post: async function (data, config = {}) {
				return await http.postFile(this.url, data, config);
			}
		},
		insertBigStory:{
			url: `${config.API_URL}/set/iciPartyNews/insertBigStory`,
			name: "创建大记录",
			post: async function (data) {
				return await http.bigPost(this.url, data,
					{headers: {'Content-Type': 'multipart/form-data'}}
				);
			}
		},
		deleteBigStoryByIds:{
			url: `${config.API_URL}/set/iciPartyNews/deleteBigStoryByIds`,
			name: "批量删除大记事",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, {
					headers: {}
				});
			}
		},
		deleteBigStory:{
			url: `${config.API_URL}/set/iciPartyNews/deleteBigStory`,
			name: "删除大记事",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, {
					headers: {}
				});
			}
		},
		updateBigStory:{
			url: `${config.API_URL}/set/iciPartyNews/updateBigStory`,
			name: "更新大记录",
			post: async function (data) {
				return await http.bigPost(this.url, data,
					{headers: {'Content-Type': 'multipart/form-data'}}
				);
			}
		},
		getBigStoryList:{
			url: `${config.API_URL}/get/iciPartyNews/getBigStoryList`,
			name: "获取所有大记事",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		getBigStoryListForManage:{
			url: `${config.API_URL}/get/iciPartyNews/getBigStoryListForManage`,
			name: "获取大纪事管理列表",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		}
	},

}